<script setup lang='ts'>
import { onMounted, ref } from 'vue';

       const aDom = ref(null)
       const bDom = ref(null)
       onMounted(()=>{
           if(aDom.value){
            const dom = aDom.value as HTMLAnchorElement
            dom.href='https://www.weibo.com'
           }
           if(bDom.value){
            const dom = bDom.value as HTMLButtonElement
            dom.onclick = () => {
        alert("这是脱裤子放屁的一种写法")
      }
           }
       })
</script>
       
<template>
       <h1>获取a的标签</h1>
       <a ref="aDom" href="https://www.baidu.com">百度</a>
       <button ref="bDom" >button的按钮</button>
</template>
       
<style scoped>
       
</style>